Get Tool Metrics
Used to retrieve execution metrics for a specific tool. This provides insights into tool usage, performance, success rates, and other operational statistics.
API Endpoint
| Property | Value |
|---|---|
| Request Method | GET |
| Request URL | https://api.seliseblocks.com/tools/{tool_id}/metrics |
Request
Request Example
curl -X GET 'https://api.seliseblocks.com/tools/{tool_id}/metrics?project_key=YOUR_PROJECT_KEY' \
-H 'accept: application/json'
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| tool_id | string | Yes | The unique identifier of the tool. |
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| project_key | string | No | The project key for your project. |
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
note
Metrics Collection
- Metrics are collected in real-time as the tool is used
- Historical data is retained for analysis and reporting
- Metrics include both successful and failed executions
- Response times are measured end-to-end
- Data is aggregated across all tool actions
tip
Use tool metrics for:
- Monitoring tool performance and reliability
- Identifying bottlenecks or slow actions
- Tracking usage patterns and trends
- Calculating success rates and error frequencies
- Capacity planning and resource allocation
- Troubleshooting integration issues
- Generating usage reports and analytics
The metrics can help you:
- Optimize tool configurations for better performance
- Identify actions that need improvement
- Understand peak usage times
- Detect anomalies or unusual patterns
- Make data-driven decisions about tool management
Response
Success Response (200 OK)
Returns comprehensive metrics for the tool.
{
"tool_id": "tool_123",
"tool_name": "Customer API",
"metrics_period": {
"start_date": "2025-12-01T00:00:00Z",
"end_date": "2026-01-12T23:59:59Z"
},
"execution_metrics": {
"total_executions": 15847,
"successful_executions": 15203,
"failed_executions": 644,
"success_rate": 95.93,
"average_response_time_ms": 342,
"median_response_time_ms": 287,
"p95_response_time_ms": 756,
"p99_response_time_ms": 1243,
"min_response_time_ms": 89,
"max_response_time_ms": 5421
},
"usage_statistics": {
"total_agents_using": 12,
"executions_last_24h": 458,
"executions_last_7d": 3214,
"executions_last_30d": 13876,
"peak_executions_per_hour": 127,
"average_executions_per_day": 462
},
"action_metrics": {
"get_customer": {
"executions": 8234,
"success_rate": 98.2,
"average_response_time_ms": 245
},
"create_customer": {
"executions": 3421,
"success_rate": 96.5,
"average_response_time_ms": 412
},
"update_customer": {
"executions": 2876,
"success_rate": 94.1,
"average_response_time_ms": 389
}
},
"error_breakdown": {
"timeout_errors": 234,
"authentication_errors": 89,
"rate_limit_errors": 156,
"server_errors": 98,
"validation_errors": 67
},
"rate_limiting": {
"total_rate_limited": 156,
"rate_limit_hit_rate": 0.98
},
"availability": {
"uptime_percentage": 99.87,
"downtime_incidents": 2,
"last_downtime": "2025-12-15T03:45:00Z"
},
"last_updated": "2026-01-12T07:38:09Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| tool_id | string | Unique identifier of the tool. |
| tool_name | string | Display name of the tool. |
| metrics_period | object | Time period covered by the metrics. |
| execution_metrics | object | Detailed execution statistics. |
| usage_statistics | object | Usage patterns and trends. |
| action_metrics | object | Per-action performance metrics. |
| error_breakdown | object | Breakdown of errors by type. |
| rate_limiting | object | Rate limiting statistics. |
| availability | object | Uptime and availability metrics. |
| last_updated | string | ISO 8601 timestamp when metrics were last updated. |
Execution Metrics Fields
| Field | Type | Description |
|---|---|---|
| total_executions | integer | Total number of tool executions. |
| successful_executions | integer | Number of successful executions. |
| failed_executions | integer | Number of failed executions. |
| success_rate | number | Success rate as a percentage. |
| average_response_time_ms | integer | Average response time in milliseconds. |
| median_response_time_ms | integer | Median response time in milliseconds. |
| p95_response_time_ms | integer | 95th percentile response time in milliseconds. |
| p99_response_time_ms | integer | 99th percentile response time in milliseconds. |
| min_response_time_ms | integer | Minimum response time in milliseconds. |
| max_response_time_ms | integer | Maximum response time in milliseconds. |
Usage Statistics Fields
| Field | Type | Description |
|---|---|---|
| total_agents_using | integer | Number of AI agents using this tool. |
| executions_last_24h | integer | Executions in the last 24 hours. |
| executions_last_7d | integer | Executions in the last 7 days. |
| executions_last_30d | integer | Executions in the last 30 days. |
| peak_executions_per_hour | integer | Highest number of executions in any hour. |
| average_executions_per_day | integer | Average executions per day. |
Action Metrics Fields
Each action in action_metrics contains:
| Field | Type | Description |
|---|---|---|
| executions | integer | Number of times this action was executed. |
| success_rate | number | Success rate for this action as a percentage. |
| average_response_time_ms | integer | Average response time for this action in milliseconds. |
Error Breakdown Fields
| Field | Type | Description |
|---|---|---|
| timeout_errors | integer | Number of timeout errors. |
| authentication_errors | integer | Number of authentication/authorization errors. |
| rate_limit_errors | integer | Number of rate limit errors. |
| server_errors | integer | Number of server-side errors (5xx). |
| validation_errors | integer | Number of validation errors (invalid input). |
Availability Fields
| Field | Type | Description |
|---|---|---|
| uptime_percentage | number | Uptime as a percentage. |
| downtime_incidents | integer | Number of downtime incidents. |
| last_downtime | string | ISO 8601 timestamp of last downtime incident. |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request parameters are invalid.
{
"detail": [
{
"loc": [
"path",
"tool_id"
],
"msg": "tool not found",
"type": "value_error.notfound"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., path, query). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 400 | Bad Request - Invalid request | Bad Request |
| 404 | Not Found - Tool does not exist | Not Found |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |